		
#region (c) Comtrade IT Solutions and Services
//
// All rights are reserved. Reproduction or transmission in whole or in part, in
// any form or by any means, electronic, mechanical or otherwise, is prohibited
// without the prior written permission of the copyright owner.
//
#endregion

#region Generated code WARNING
//----------------------------------------------------------------------------------------
// This is generated code. If you modify this code, be aware
// of the fact that when you re-generate the code, your changes
// are lost. If you want to keep your changes, make this file read-only
// when you have finished your changes, however it is recommended that
// you create partial class from this class to extend the functionality of this generated
// class or you modify / extend the templates used to generate this code.
//----------------------------------------------------------------------------------------
// Code is generated using t4 templates
// Code is generated on: 26.01.2011 22:58
// Templates vendor: Comtrade IT Solutions and Services (c).
//----------------------------------------------------------------------------------------
#endregion Generated code WARNING

#region Using
using System;
using System.Data;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.Collections.Generic;
#endregion Using

namespace Snipebay.DataModels
{
	/// <summary>
    /// ApplicationUser class definition
    /// </summary>
	[Serializable]
	[DataContractAttribute(Namespace = "Snipebay.ServiceDataContract", Name = "ApplicationUserEntity")]
	public partial class ApplicationUserEntity : BaseEntity, IApplicationUser
	{
		#region Fields
		private int mId;
		private string mUsername;
		private byte[] mPassword;
		#endregion Fields

		#region Constructors

		/// <summary>
		/// ApplicationUser class default ctor
		/// </summary>
		public ApplicationUserEntity() : base() { }

		/// <summary>
		/// ApplicationUser class ctor with all fields
		/// </summary>
		public ApplicationUserEntity(int id, string username, byte[] password)
		{
			mId = id;
			mUsername = username;
			mPassword = password;
		}

		/// <summary>
		/// ApplicationUser class ctor with data record
		/// </summary>
		public ApplicationUserEntity(IDataRecord dataRecord): base(dataRecord)
		{
			int.TryParse(dataRecord["ApplicationUserId"].ToString(), out mId);
			//mId = GetValueHelper.GetValue<int>(dataRecord, "ApplicationUserId");
			mUsername = dataRecord["Username"].ToString();
			//mUsername = GetValueHelper.GetValue<string>(dataRecord, "Username");
			byte[].TryParse(dataRecord["Password"].ToString(), out mPassword);
			//mPassword = GetValueHelper.GetValue<byte[]>(dataRecord, "Password");
			FillExtendedProperties(dataRecord);
		}

		#endregion Constructors

		#region Properties

		/// <summary>
		/// ApplicationUserId property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "Id", Order = 1)]
		public int Id
		{
			get
			{
				return mId;
			}
			set
			{
				mId = value;
			}
		}

		/// <summary>
		/// Username property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "Username", Order = 2)]
		public string Username
		{
			get
			{
				return mUsername;
			}
			set
			{
				mUsername = value;
			}
		}

		/// <summary>
		/// Password property field
		/// </summary>
		[DataMember(IsRequired = false, Name = "Password", Order = 3)]
		public byte[] Password
		{
			get
			{
				return mPassword;
			}
			set
			{
				mPassword = value;
			}
		}

		#endregion Properties
	}
}
